package com.extension.company.view.income;

import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.Button;

import com.extension.company.admin.R;
import com.extension.company.common.mvp.BaseTitleActivity;
import com.extension.company.contract.income.WithdrawCashContract;
import com.extension.company.presenter.income.WithdrawCashPresenter;
import com.extension.company.common.widget.popuwindow.PwWithdrawCash;

import butterknife.BindView;

public class WithdrawCash extends BaseTitleActivity<WithdrawCashContract.View, WithdrawCashPresenter>
        implements WithdrawCashContract.View, View.OnClickListener {

    @BindView(R.id.btn_cash)
    Button btn_cash;

    private PwWithdrawCash pwWithdrawCash;

    public static void startActivity(Activity activity) {
        Intent intent = new Intent(activity, WithdrawCash.class);
        activity.startActivity(intent);
    }

    @Override
    protected void initData() {
        setTitle("提现");
        pwWithdrawCash = new PwWithdrawCash(this);
    }

    @Override
    protected void initListener() {
        btn_cash.setOnClickListener(this);
        setOnPwAddressListAddListener();
    }

    @Override
    public int getMainLayout() {
        return R.layout.withdrawcash;
    }

    @Override
    public WithdrawCashContract.View createView() {
        return this;
    }

    @Override
    public WithdrawCashPresenter createPresenter() {
        return new WithdrawCashPresenter();
    }

    @Override
    public void showLoading() {

    }

    @Override
    public void hideLoading() {

    }

    @Override
    public void onError(Throwable throwable) {

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_cash:
                pwWithdrawCash.show();
                break;
            default:
                break;
        }
    }

    private void setOnPwAddressListAddListener() {
        pwWithdrawCash.setOnPwAddressListAddListener(new PwWithdrawCash.OnPwWithdrawCashListener() {
            @Override
            public void cancel() {

            }

            @Override
            public void ok() {
                WithdrawCash2.startActivity(WithdrawCash.this);
            }
        });
    }
}
